pub fn can_construct(ransom_note: String, magazine: String) -> bool {
    let ransom_note = ransom_note.as_bytes();
    let magazine = magazine.as_bytes();

    let mut r_counts = [0 as usize; ('z' as usize) - ('a' as usize) + 1];
    let mut m_counts = r_counts.clone();

    for i in magazine {
        let j = *i - ('a' as u8);
        m_counts[j as usize] += 1;
    }

    for r in ransom_note {
        // 获取j在数组中的位置
        let r_index = usize::from(*r - ('a' as u8));
        // 获取j在magazine中的数量
        let i = m_counts[r_index];
        // 获取j在r_counts中的数量
        let count_j = r_counts[r_index];
        // 需要的字符数大于已有的字符数
        if count_j + 1 > i {
            return false;
        }
        r_counts[r_index] += 1;
    }

    return true;
}
